<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl"> 新增大转盘活动</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 大转盘标题 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="lottery[title]"
                                           value="" placeholder="">
                                </div>
                            </div>
<!--                            <div class="am-form-group">-->
<!--                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 选择商品 </label>-->
<!--                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">-->
<!--                                    <div class="am-form-file am-margin-top-xs">-->
<!--                                        <button type="button"-->
<!--                                                class="j-selectGoods upload-file am-btn am-btn-secondary am-radius">-->
<!--                                            <i class="am-icon-cloud-upload"></i> 选择商品-->
<!--                                        </button>-->
<!--                                        <div class="widget-goods-list uploader-list am-cf">-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                    <div class="help-block">-->
<!--                                        <small>注：砍价活动仅支持单规格商品 或 同价的多规格商品</small>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </div>-->

                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 活动时间 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <!-- 会员等级列表-->
                                    <div class="am-input-group">
                                        <input type="text" class="j-laydate-start am-form-field"
                                               name="lottery[start_time]"
                                               placeholder="开始时间">
                                        <span class="am-input-group-label am-input-group-label__center">至</span>
                                        <input type="text" class="j-laydate-end am-form-field"
                                               name="lottery[end_time]"
                                               placeholder="结束时间">
                                    </div>
                                    <div class="help-block">
                                        <small>大转盘活动的开始时间与截止时间</small>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 虚拟参与人数 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="number" min="0" class="tpl-form-input" name="lottery[xuni_canyu]"
                                           required>
                                    <small>注：前台参与人数 = 虚拟人数 + 实际人数</small>
                                </div>
                            </div>
                            <!-- 一等奖 -->
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 一等奖 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('yi_',10)" name="lottery_jiangpin[0][types]" value="10" data-am-ucheck
                                               checked>
                                        免单
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('yi_',20)" name="lottery_jiangpin[0][types]" value="20" data-am-ucheck>
                                        积分
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('yi_',30)" name="lottery_jiangpin[0][types]" value="30" data-am-ucheck>
                                        优惠券
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('yi_',40)" name="lottery_jiangpin[0][types]" value="40" data-am-ucheck>
                                        实物
                                    </label>
                                </div>
                            </div>
                            <div id="yidengjiang">
                                <!-- 积分 -->
                                <div class="am-form-group" id="yi_20" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[0][points]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 积分 -->
                                <!-- 优惠券 -->
                                <div class="am-form-group" id="yi_30" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>

                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <?php if (!$couponLists->isEmpty()): ?>
                                            <?php foreach ($couponLists as $item): ?>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="lottery_jiangpin[0][coupon_id]" value="<?= $item['coupon_id'] ?>" data-am-ucheck>
                                                    <?= $item['name'] ?>
                                                </label>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            请创建优惠券
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <!-- 优惠券 -->
                                <!-- 实物 -->
                                <div class="am-form-group" id="yi_40" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[0][content]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 实物 -->
                            </div>
                            <!-- 一等奖 -->
                            <!-- 二等奖 -->
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 二等奖 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('er_',10)" name="lottery_jiangpin[1][types]" value="10" data-am-ucheck
                                               checked>
                                        免单
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('er_',20)" name="lottery_jiangpin[1][types]" value="20" data-am-ucheck>
                                        积分
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('er_',30)" name="lottery_jiangpin[1][types]" value="30" data-am-ucheck>
                                        优惠券
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('er_',40)" name="lottery_jiangpin[1][types]" value="40" data-am-ucheck>
                                        实物
                                    </label>
                                </div>
                            </div>
                            <div id="yidengjiang">
                                <!-- 积分 -->
                                <div class="am-form-group" id="er_20" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[1][points]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 积分 -->
                                <!-- 优惠券 -->
                                <div class="am-form-group" id="er_30" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>

                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <?php if (!$couponLists->isEmpty()): ?>
                                            <?php foreach ($couponLists as $item): ?>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="lottery_jiangpin[1][coupon_id]" value="<?= $item['coupon_id'] ?>" data-am-ucheck>
                                                    <?= $item['name'] ?>
                                                </label>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            请创建优惠券
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <!-- 优惠券 -->
                                <!-- 实物 -->
                                <div class="am-form-group" id="er_40" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[1][content]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 实物 -->
                            </div>
                            <!-- 二等奖 -->
                            <!-- 三等奖 -->
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 三等奖 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('san_',10)" name="lottery_jiangpin[2][types]" value="10" data-am-ucheck
                                               checked>
                                        免单
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('san_',20)" name="lottery_jiangpin[2][types]" value="20" data-am-ucheck>
                                        积分
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('san_',30)" name="lottery_jiangpin[2][types]" value="30" data-am-ucheck>
                                        优惠券
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('san_',40)" name="lottery_jiangpin[2][types]" value="40" data-am-ucheck>
                                        实物
                                    </label>
                                </div>
                            </div>
                            <div id="yidengjiang">
                                <!-- 积分 -->
                                <div class="am-form-group" id="san_20" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[2][points]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 积分 -->
                                <!-- 优惠券 -->
                                <div class="am-form-group" id="san_30" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>

                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <?php if (!$couponLists->isEmpty()): ?>
                                            <?php foreach ($couponLists as $item): ?>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="lottery_jiangpin[2][coupon_id]" value="<?= $item['coupon_id'] ?>" data-am-ucheck>
                                                    <?= $item['name'] ?>
                                                </label>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            请创建优惠券
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <!-- 优惠券 -->
                                <!-- 实物 -->
                                <div class="am-form-group" id="san_40" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[2][content]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 实物 -->
                            </div>
                            <!-- 三等奖 -->
                            <!-- 四等奖 -->
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 四等奖 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('si_',10)" name="lottery_jiangpin[3][types]" value="10" data-am-ucheck
                                               checked>
                                        免单
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('si_',20)" name="lottery_jiangpin[3][types]" value="20" data-am-ucheck>
                                        积分
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('si_',30)" name="lottery_jiangpin[3][types]" value="30" data-am-ucheck>
                                        优惠券
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('si_',40)" name="lottery_jiangpin[3][types]" value="40" data-am-ucheck>
                                        实物
                                    </label>
                                </div>
                            </div>
                            <div id="yidengjiang">
                                <!-- 积分 -->
                                <div class="am-form-group" id="si_20" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[3][points]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 积分 -->
                                <!-- 优惠券 -->
                                <div class="am-form-group" id="si_30" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>

                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <?php if (!$couponLists->isEmpty()): ?>
                                            <?php foreach ($couponLists as $item): ?>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="lottery_jiangpin[3][coupon_id]" value="<?= $item['coupon_id'] ?>" data-am-ucheck>
                                                    <?= $item['name'] ?>
                                                </label>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            请创建优惠券
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <!-- 优惠券 -->
                                <!-- 实物 -->
                                <div class="am-form-group" id="si_40" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[3][content]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 实物 -->
                            </div>
                            <!-- 四等奖 -->
                            <!-- 五等奖 -->
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 五等奖 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('wu_',10)" name="lottery_jiangpin[4][types]" value="10" data-am-ucheck
                                               checked>
                                        免单
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('wu_',20)" name="lottery_jiangpin[4][types]" value="20" data-am-ucheck>
                                        积分
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('wu_',30)" name="lottery_jiangpin[4][types]" value="30" data-am-ucheck>
                                        优惠券
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" onclick="typesJiangPin('wu_',40)" name="lottery_jiangpin[4][types]" value="40" data-am-ucheck>
                                        实物
                                    </label>
                                </div>
                            </div>
                            <div id="yidengjiang">
                                <!-- 积分 -->
                                <div class="am-form-group" id="wu_20" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[4][points]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 积分 -->
                                <!-- 优惠券 -->
                                <div class="am-form-group" id="wu_30" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>

                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <?php if (!$couponLists->isEmpty()): ?>
                                            <?php foreach ($couponLists as $item): ?>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="lottery_jiangpin[4][coupon_id]" value="<?= $item['coupon_id'] ?>" data-am-ucheck>
                                                    <?= $item['name'] ?>
                                                </label>
                                            <?php endforeach; ?>
                                        <?php else: ?>
                                            请创建优惠券
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <!-- 优惠券 -->
                                <!-- 实物 -->
                                <div class="am-form-group" id="wu_40" style="display: none;">
                                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">  </label>
                                    <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                        <input type="text" class="tpl-form-input" name="lottery_jiangpin[4][content]"
                                               value="" placeholder="">
                                    </div>
                                </div>
                                <!-- 实物 -->
                            </div>
                            <!-- 五等奖 -->
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 分享标题 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="lottery[share_title]"
                                           value="免单大奖等你抽！！！" required>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label"> 抽奖助力语 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="lottery[prompt_words]"
                                           value="&#34;朋友一生一起走，助力一下有没有&#34;">
                                </div>
                            </div>

                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 活动状态 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="lottery[lottery_status]" value="10" data-am-ucheck
                                               checked>
                                        启用
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="lottery[lottery_status]" value="20" data-am-ucheck>
                                        禁用
                                    </label>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-sm am-btn-secondary"> 提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="assets/common/plugins/laydate/laydate.js"></script>
<script src="assets/store/js/select.data.js?v=<?= $version ?>"></script>
<script>
    function typesJiangPin(divId,index) {
        if(index == 10){
            //免单
            $('#'+divId+'10').hide()
            $('#'+divId+'20').hide()
            $('#'+divId+'30').hide()
            $('#'+divId+'40').hide()
        }else if(index == 20){
            //积分
            $('#'+divId+'10').hide()
            $('#'+divId+'20').show()
            $('#'+divId+'30').hide()
            $('#'+divId+'40').hide()
        }else if(index == 30){
            //优惠券
            $('#'+divId+'10').hide()
            $('#'+divId+'20').hide()
            $('#'+divId+'30').show()
            $('#'+divId+'40').hide()
        }else if(index == 40){
            //实物
            $('#'+divId+'10').hide()
            $('#'+divId+'20').hide()
            $('#'+divId+'30').hide()
            $('#'+divId+'40').show()
        }
    }
    $(function () {


        // 时间选择器
        laydate.render({
            elem: '.j-laydate-start'
            , type: 'datetime'
        });

        // $('.j-laydate-start').blur()
        // $activeTimeInput.blur()


        // 时间选择器
        laydate.render({
            elem: '.j-laydate-end'
            , type: 'datetime'
        });

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();

    });
</script>
